. as $root | 
  [.products[], .packages[]] | 
  group_by(.cve_id) | 
  (["| CVE ID        | Count | Components |",
    "| ------------- | ----- | ---------- |"] +
   [.[] | 
    "| \(.[0].cve_id)  | \([.[] | .name] | unique | length)     | \([.[] | .name] | unique | join(", ")) |"]) | 
  .[]
